<?php
namespace app\base\model;
use app\base\CommonModel;
use app\base\model\Coupons;
class UserCoupon extends CommonModel {
  public function getCouponsList($user_id){
     return $this->alias('uc')
           ->join('yc_coupons c','uc.cid=c.c_id','left')
           ->where(['uc.uid'=>$user_id,'uc.status'=>1])
           ->field('uc.id,uc.uid,uc.cid,uc.status,c.amount,c.cond_amount,c.yc_coin,c.img_path,c.start_time,c.end_time')
           ->order('uc.id','desc')
           ->select();
  }
}